package com.jkgh.remedium.states {
	import com.jkgh.remedium.RemediumSystem;

	public class GatheringState implements RemediumState {
	
		private var needed:int;
		private var onNeededBytesAvailable:Function;
		
		public function GatheringState(needed:int, onNeededBytesAvailable:Function) {
			this.needed = needed;
			this.onNeededBytesAvailable = onNeededBytesAvailable;
		}
	
		public function onBytesAvailable(remedium:RemediumSystem):void {
			if (remedium.bytesAvailable() >= needed) {
				onNeededBytesAvailable(remedium);
			}
		}

	}
}